package pers.huangyuhui.sms.service.impl;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;
import pers.huangyuhui.sms.mapper.AdminMapper;
import pers.huangyuhui.sms.model.AdminInfo;
import pers.huangyuhui.sms.service.AdminService;
import pers.huangyuhui.sms.util.MyBatisUtil;

@Service(value = "adminService")
public class AdminServiceImpl implements AdminService {

    SqlSession sqlSession = MyBatisUtil.getSqlSession();
    AdminMapper adminMapper = sqlSession.getMapper(AdminMapper.class);

    /**
     * @Title: getUserInfo
     * @Description: 获取用户信息
     * @param: name
     * @param: password
     * @return: AdminInfo
     */
    @Override
    public AdminInfo getUserInfo(String name, String password) {
        return adminMapper.getUserInfo(name, password);
    }

    /**
     * @Title: modifyPassword
     * @Description: 修改密码
     * @param: newPassword
     * @param: id
     * @return: boolean
     */
    @Override
    public boolean modifyPassword(String newPassword, String id) {
        return adminMapper.modifyPassword(newPassword, id);
    }
}
